package org.legzo.castorranker.web;

import java.io.Serializable;
import java.util.Date;
import java.util.SortedMap;

import org.legzo.castorranker.ranker.Game;
import org.legzo.castorranker.ranker.Player;

public class PlayerDto implements Serializable {

	private static final long serialVersionUID = 2419902032122981835L;

	private Player player;
	private int score;

	public void setName(String name) {
		player.setName(name);
	}

	public PlayerDto(Player p) {
		this.player = p;
	}

	public Game getLastPlayedGame(Date d) {
		return player.getLastPlayedGame(d);
	}

	public long getLastRankingVariation() {
		return player.getLastRankingVariation();
	}

	public String getName() {
		return player.getName();
	}

	public long getRanking() {
		return player.getRanking();
	}

	public SortedMap<Game, Long> getRankings() {
		return player.getRankings();
	}

	public long getRankingVariationForDate(Date d) {
		return player.getRankingVariationForDate(d);
	}

	public void setScore(int score) {
		this.score = score;
	}

	public int getScore() {
		return score;
	}

	@Override
	public String toString() {
		return "PlayerDto [player=" + player + ", score=" + score + "]";
	}

	public Player getPlayer() {
		return player;
	}

}
